<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>字符串拼接</title>
  </head>
  <body>
    <script>
      // 字符串的拼接
      console.log(20 + 30); // 返回 50
      console.log('12' + 12); // 返回 '1212'
      console.log('ab' + ' ' + 'cd'); // 返回 'ab cd'
      console.log('a' + undefined); // 返回 'aundefined'
      console.log('a' + null); // 返回 'anull'

      // 变量和字符串拼接
      var age = 28;
      console.log('阿程' + age + '岁了');
    </script>
  </body>
</html>
